package com.tonghe.dao;

import com.tonghe.pojo.User;
import com.tonghe.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

/**
 * @Date:2021/12/18- 12- 18- 13:25
 **/
public class UserDao {

    @Test
    public void testGetList(){
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
        User user = userMapper.getUserById(2);
        System.out.println(user.toString());
        System.out.println("而在navicat中:");
        System.out.println("User{id=2, username='user002', password='password002'}");
    }
}
